# https://github.com/li9chuan/jscomp
import time;
import zlib;
import json;
import struct;

import os

output = open('zlibgame.cfg', 'wb')

jsontxt = {}

path = 'E:\\gitee.com\\maxwell_xu\\egret-extension-library\\example\\zlib_compress\\cfg\\'
files = os.listdir(path.decode('utf-8'))

for f in files:
	arr = f.split('.')
	name = arr[0].lower() + "_" + arr[1];
	print(name)
	
	tf = open(path + f, 'rb')
	
	try:
		file_txt = tf.read()
	finally:
		tf.close()
	
	jsontxt[name] = file_txt
		
str = zlib.compress(json.dumps(jsontxt), zlib.Z_BEST_COMPRESSION)
output.write( str )
output.close()
time.sleep(1);